home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / emulator / bsvc-1.000 / bsvc-1 / bsvc-1.0.4 / src / Framework / Interface.hxx < prev    next >
Text File  |  1995-07-26  |  3KB  |  90 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. // $Id: Interface.hxx,v 1.1 1994/08/03 22:54:26 bmott Exp $
  3. ///////////////////////////////////////////////////////////////////////////////
  4. // Interface.hxx
  5. //
  6. // This is the user interface command class.  It handles all of the
  7. // command's issue by the user interface.
  8. //
  9. //
  10. // BSVC "A Microprocessor Simulation Framework"
  11. // Copyright (c) 1993
  12. // By: Bradford W. Mott
  13. // October 21,1993
  14. //
  15. ///////////////////////////////////////////////////////////////////////////////
  16. // $Log: Interface.hxx,v $
  17. // Revision 1.1  1994/08/03  22:54:26  bmott
  18. // Initial revision
  19. //
  20. //
  21. ///////////////////////////////////////////////////////////////////////////////
  22.  
  23. #ifndef INTERFACE_HXX
  24. #define INTERFACE_HXX
  25.  
  26. #include "BasicCPU.hxx"
  27. #include "BasicDeviceRegistry.hxx"
  28. #include "BasicLoader.hxx"
  29. #include "BreakpointList.hxx"
  30.  
  31. class Interface;
  32.  
  33. typedef struct {
  34.   const char *name;
  35.   void (Interface::*mfp)(char*);
  36. } UICommandTable;
  37.  
  38. class Interface {
  39.   private:
  40.     const int number_of_commands;      // Number of commands in command table
  41.     static int interrupt_signal_flag;
  42.     static void InterruptSignalHandler(int);
  43.  
  44.     BasicCPU* const cpu;
  45.     BasicDeviceRegistry* const device_registry;
  46.     BasicLoader* const loader;
  47.     BreakpointList breakpoint_list;
  48.  
  49.     char *Get();                       // Get a string from the UI
  50.     void Put(const char *);            // Send a string to the UI
  51.     int  ExecuteCommand(const char*);  // Execute the command
  52.  
  53.  
  54.     static UICommandTable command_table[];
  55.  
  56.     void AddBreakpoint(char *);
  57.     void AttachDevice(char *);
  58.     void ClearStatistics(char *);
  59.     void DeleteBreakpoint(char *);
  60.     void DetachDevice(char *);
  61.     void ListAttachedDevices(char *);
  62.     void ListBreakpoints(char *);
  63.     void ListDevices(char *);
  64.     void ListDeviceScript(char *);
  65.     void ListExecutionTraceRecord(char *);
  66.     void ListDefaultExecutionTraceEntries(char *);
  67.     void ListGranularity(char *);
  68.     void ListMemory(char *);
  69.     void ListMaximumAddress(char *);
  70.     void ListNumberOfAddressSpaces(char *);
  71.     void ListPCRegisterName(char *);
  72.     void ListRegisters(char *);
  73.     void ListRegisterValue(char *);
  74.     void ListRegisterDescription(char *);
  75.     void ListStatistics(char *);
  76.     void LoadProgram(char *);
  77.     void Reset(char *);
  78.     void Run(char *);
  79.     void SetRegister(char *);
  80.     void SetMemory(char *);
  81.     void Step(char *);
  82.  
  83.   public:
  84.     Interface(BasicCPU*, BasicDeviceRegistry*, BasicLoader*);
  85.  
  86.     void CommandLoop();
  87. };
  88.  
  89. #endif
  90.